import React, { Component } from "react";

import "./index.scss";
import Login from "./Login";
import Register from "./Register";

class LoginView extends Component {
  constructor(props) {
    super(props);
    this.state = {
      login: true,
    };
  }

  toggleView = () => {
    this.setState({
      login: !this.state.login,
    });
  };

  render() {
    return (
      <div className="form-wrap">
        {this.state.login ? (
          <Login toReg={this.toggleView} />
        ) : (
          <Register toLogin={this.toggleView} />
        )}
      </div>
    );
  }
}

export default LoginView;
